Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed find_first_model to cope with Mongoid 3.0.0 #41

Closed
wants to merge 2 commits into from

Conversation

julescopeland
Copy link

Klass.first(conditions) no longer works in Mongoid 3 (it breaks with an ArgumentError).

Updated the method to stop it raising errors. (It should still work in previous versions too).

@ianwhite
Copy link
Owner

ianwhite commented Jul 6, 2012

Many thanks!

bbenezech added a commit to bbenezech/pickle that referenced this pull request Oct 15, 2012
Changed find_first_model to cope with Mongoid 3.0.0
@jondkinney
Copy link
Contributor

Looks to be a duplicate of #47 (I know, this one was created first :) However, I recommend closing this and merging #47 as it has some additional code.

@chewi
Copy link
Contributor

chewi commented Nov 18, 2014

Agreed.

@chewi chewi closed this Nov 18, 2014
@chewi
Copy link
Contributor

chewi commented Nov 21, 2014

Strike that, reverse it. #47 was for ActiveRecord, this is for Mongoid.

@chewi chewi reopened this Nov 21, 2014
@jondkinney
Copy link
Contributor

Aaaah! Sorry. The code is the exact same, but it's in different files. I didn't notice that!

Do we need to update https://github.com/julescopeland/pickle/blob/master/lib/pickle/adapters/mongoid.rb#L35 too? Seems like it could be:

klass.all(conditions)

@chewi
Copy link
Contributor

chewi commented Nov 21, 2014

Already on it. Fixed in a backwards-compatible way.

@chewi chewi closed this Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants